<!DOCTYPE html>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>电商大数据管理平台</title>
	<link rel="icon" href="icon.ico">
	<link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="css/dashboard.css" rel="stylesheet">
	<!--[if lt IE 9]>
	<script src="plugins/html5shiv/html5shiv.min.js"></script>
	<script src="plugins/respond/respond.min.js"></script>
	<![endif]-->
	<link rel="stylesheet" href="plugins/datatables/css/dataTables.bootstrap.min.css">
	<link rel="stylesheet" href="css/datatables.css">
	<link rel="stylesheet" href="plugins/element-ui/theme-default/index.css" />
	<style>
		.count-item {
			position: relative;
			border: 1px solid #ddd;
			border-radius: 4px;
			display: block;
			overflow: hidden;
			min-width: 200px;
		}
		.count-item:hover {
			text-decoration: none;
		}
		.count-item .glyphicon {
			position: absolute;
			top: 30px;
			left: 15px;
			font-size: 36px;
		}
		.count-item .count-item-text {
			padding: 15px;
			margin-left: 65px;
			border-left: 1px solid #eee;
		}
		.count-item .count-item-text .count-item-num {
			font-size: 36px;
			font-weight: bold;
		}
	</style>
</head>

<body>
<div id="app">
	<nav class="navbar navbar-default navbar-fixed-top">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#" style="font-size: x-large;"><strong><b>电商大数据管理平台</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></a>
			</div>
			<div id="navbar" class="navbar-collapse collapse">
				<navbars :acv="bnav"></navbars>
			</div>
		</div>
	</nav>



	<div class="container-fluid" style="margin-bottom:30px;">
		<div class="row">
			<managenav></managenav>
			<div class="col-sm-9 col-sm-offset-3 col-md-offset-2 col-md-10 main">
				<div class="row">
					<div class="col-xs-12">
						<h2 style="color: #0D81F5;"><b>数据采集概况</b></h2></div>
				</div>

				<div class="placeholders alert alert-info" style="padding-top: 10px;padding-bottom: 10px;overflow:hidden;">
					<div class="pull-left" style="margin:8px 20px;">
						<h4><img src="images/sx.png" style="margin-left: -24px;margin-top: -3px;">数据统计概况</h4>
					</div>
				</div>

				<ul class="list-unstyled list-inline">
					<li>
						<a href="platformManage.html" class="count-item">
							<i class="glyphicon glyphicon-cloud"></i>
							<div class="count-item-text">
								<div class="count-item-title">店铺</div>
								<div class="count-item-num">{{businessCount}}</div>
							</div>
						</a>
					</li>
					<li>
						<a href="logisticsManage.html" class="count-item">
							<i class="glyphicon glyphicon-plane text-info"></i>
							<div class="count-item-text">
								<div class="count-item-title">物流</div>
								<div class="count-item-num">{{logisticsCount}}</div>
							</div>
						</a>
					</li>
					<li>
						<a href="siteManage.html" class="count-item">
							<i class="glyphicon glyphicon-tree-deciduous text-danger"></i>
							<div class="count-item-text">
								<div class="count-item-title">服务站点</div>
								<div class="count-item-num">{{serviceCount}}</div>
							</div>
						</a>
					</li>
					<li>
						<a href="trainManage.html" class="count-item">
							<i class="glyphicon glyphicon-dashboard text-warning"></i>
							<div class="count-item-text">
								<div class="count-item-title">培训</div>
								<div class="count-item-num">{{trainCount}}</div>
							</div>
						</a>
					</li>
					<li>
						<a href="productManage.html" class="count-item">
							<i class="glyphicon glyphicon-asterisk text-primary"></i>
							<div class="count-item-text">
								<div class="count-item-title">产品产业</div>
								<div class="count-item-num">{{productCount}}</div>
							</div>
						</a>
					</li>
				</ul>

				<!--				<div style="margin:30px 10px;">
                                    <a href="platformManage.html" class="btn btn-lg btn-primary"><i class="glyphicon glyphicon-cloud"></i> 平台管理（1308）</a>
                                    <a href="logisticsManage.html" class="btn btn-lg btn-info"><i class="glyphicon glyphicon-plane"></i> 物流管理（418）</a>
                                    <a href="siteManage.html" class="btn btn-lg btn-danger"><i class="glyphicon glyphicon-tree-deciduous"></i> 服务站点管理（795）</a>
                                    <a href="trainManage.html" class="btn btn-lg btn-warning"><i class="glyphicon glyphicon-dashboard"></i> 培训管理（31737人）</a>
                                    <a href="productManage.html" class="btn btn-lg btn-primary"><i class="glyphicon glyphicon-asterisk"></i> 产品/产业管理（2752）</a>
                                </div>-->

				<div class="placeholders alert alert-info" style="padding-top: 10px;padding-bottom: 10px;overflow:hidden;">
					<div class="pull-left" style="margin:5px 20px;">
						<h4><img src="images/sx.png" style="margin-left: -24px;margin-top: -3px;">最新采集记录</h4>
					</div>
				</div>

				<div class="table-responsive">
					<el-table :data="selfPlatform.searchData" stripe border style="width: 100%">
						<el-table-column prop="createTime" label="时间" align="center"></el-table-column>
						<el-table-column prop="platFormName" label="平台" align="center"></el-table-column>
						<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
						<el-table-column prop="categoryName" label="产品种类" align="center"></el-table-column>
						<el-table-column prop="tradingVolume" label="交易额(元)" align="center"></el-table-column>
						<el-table-column label="数据源" align="center">
							<template scope="props">
								<a :href="props.row.storeUrl" target="_blank">{{props.row.storeUrl}}</a>
							</template>
						</el-table-column>
						<el-table-column label="采集方式" align="center">
							<template scope="props">
								自动采集
							</template>
						</el-table-column>
					</el-table>
				</div>
			</div>
		</div>

	</div>
</div>

<script src="plugins/jquery/jquery.min.js"></script>
<script src="plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="js/vue.min.js"></script>
<script type="text/javascript" src="js/nav.js"></script>
<script src="plugins/element-ui/index.js"></script>
<script src="js/common.js"></script>
<script>
	new Vue({
			el: "#app",
			data: {
				bnav: {
					number: 1,
				},
				selfPlatform: {
					searchData: []
				},
				"logisticsCount": 0,
			    "serviceCount": 0,
			    "productCount": 0,
			    "trainCount": 0,
			    "businessCount": 0
			},
			computed: {
				activeTabA:function() {
					return(this.tab !== 'tab2') ? 'tab-pane fade in active' : 'tab-pane fade';
				},
				activeTabB:function() {
					return(this.tab === 'tab2') ? 'tab-pane fade in active' : 'tab-pane fade';
				}
			},
			mounted: function() {
				this.getSelfData();
				this.getSurvey()
				this.tab = GetQueryString("tab");
			},
			methods: {
				arrUnique:function(arr, key) {
					var result = [],
						hash = {};
					for(var i = 0, elem;
						(elem = arr[i]) != null; i++) {
						var str = elem[key];
						if(!hash[str]) {
							hash[str] = true;
							result.push({
								text: str,
								value: str
							});
						}
					}
					return result;
				},
				getSelfData:function() {
					var vm = this;
					$.ajax({
						type: "get",
						url: "/ebb/front/ebb/news/data/",
						dataType: "json",
						async: false,
						success: function(data) {
							vm.selfPlatform.searchData = data;
							for(var i=0;i<data.length;i++){
								var str = data[i].createTime.substring(0,10)
								vm.selfPlatform.searchData[i].createTime = str;
							}
						},
                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                            if(XMLHttpRequest.status==401){
                                //跳转到登录页,带上登录后的跳转地址redirect_uri=???
                                // redirect_login();

                                ShowTip("你还没有登录，请先登录！", "success", 1000);
                                setTimeout(function () {
                                    window.location.href = "login.html"
                                }, 1000);
                            }
                        }
					});
				},
				getSurvey:function() {
					var vm = this;
					$.ajax({
						type: "get",
						url: "/ebb/front/ebb/data/survey/",
						dataType: "json",
						async: false,
						success: function(data) {
							vm.logisticsCount = data.logisticsCount;
							vm.serviceCount = data.serviceCount;
							vm.productCount = data.productCount;
							vm.trainCount = data.trainCount;
							vm.businessCount = data.businessCount;
						},
                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                            if(XMLHttpRequest.status==401){
                                //跳转到登录页,带上登录后的跳转地址redirect_uri=???
                                // redirect_login();

                                ShowTip("你还没有登录，请先登录！", "success", 1000);
                                setTimeout(function () {
                                    window.location.href = "login.html"
                                }, 1000);
                            }
                        }
					});
				}
			}
		});
</script>

<script src="js/ie10-viewport-bug-workaround.js"></script>
</body>

</html>